﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Smile.Network.Http
{
    /// <summary>Interface to perform a download operation.</summary>
    ///
    /// <remarks>
    ///     IHttpDownload is designed for long-term transfer operations for resources like video,
    ///     music, and large images. For short-term operations involving transfers of smaller
    ///     resources (i.e. a couple KB), the use of IHttpRequest objects is recommended.
    /// </remarks>
    public interface IHttpDownloader
    {
        // @Events
        event EventHandler<DownloadInfo> DownloadProgressChanged;


        // @Members functions
        /// <summary>
        ///     Send a GET request to the specified Uri as an asynchronous operation.
        /// </summary>
        ///
        /// <param name="uri">The Uri the request is sent to.</param>
        ///
        /// <returns>The task object representing the asynchronous operation.</returns>
        Task<HttpResponse> DownloadAsync(string uri);

        /// <summary>
        ///     Send a GET request to the specified Uri as an asynchronous operation.
        /// </summary>
        ///
        /// <param name="uri">The Uri the request is sent to.</param>
        ///
        /// <returns>The task object representing the asynchronous operation.</returns>;
        Task<HttpResponse> DownloadAsync(Uri uri);
    }
}
